package com.dxt.service;

import com.dxt.dao.DeliveryDao;
import com.dxt.dao.DeliveryDaoImpl;
import com.dxt.pojo.Delivery;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

/**
 * BelongProject: deliveryManage
 * BelongPackage: com.dxt.service
 * Description:
 *
 * @Author 段鑫涛
 * @Create 2025/3/30 23:40
 * @Version 1.0
 */
public class DeliveryServiceImpl implements DeliveryService{
    private DeliveryDao deliveryDao = new DeliveryDaoImpl();
    @Override
    public List<Delivery> getDeliveryListByUserId(Integer id) throws SQLException {
        return deliveryDao.getDeliveryListByUserId(id);
    }

    @Override
    public void addDeliveryByUserId(String deliveryName, Integer id, String companyId, String phone, String address, String sendTime, String state) throws SQLException {
        deliveryDao.addDeliveryByUserId(deliveryName, id, companyId, phone, address, sendTime, state);
    }

    @Override
    public void deleteDeliveryById(String id) throws SQLException {
        deliveryDao.deleteDeliveryById(id);
    }

    @Override
    public Delivery getDeliveryListByDeliveryId(String id) throws SQLException {
        return deliveryDao.getDeliveryListByDeliveryId(id);

    }

    @Override
    public void updateDeliveryByDeliveryId(Map<String, String> map, Integer userId) throws SQLException {
        deliveryDao.updateDeliveryByDeliveryId(map, userId);
    }
}
